import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkWithdrawalLogVO, SkWithdrawalLogForm, SkWithdrawalLogQuery } from '@/api/app/SkWithdrawalLog/types';

/**
 * 查询提现信息LOG列表
 * @param query
 * @returns {*}
 */

export const listSkWithdrawalLog = (query?: SkWithdrawalLogQuery): AxiosPromise<SkWithdrawalLogVO[]> => {
  return request({
    url: '/app/SkWithdrawalLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询提现信息LOG详细
 * @param id
 */
export const getSkWithdrawalLog = (id: string | number): AxiosPromise<SkWithdrawalLogVO> => {
  return request({
    url: '/app/SkWithdrawalLog/' + id,
    method: 'get'
  });
};

/**
 * 新增提现信息LOG
 * @param data
 */
export const addSkWithdrawalLog = (data: SkWithdrawalLogForm) => {
  return request({
    url: '/app/SkWithdrawalLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改提现信息LOG
 * @param data
 */
export const updateSkWithdrawalLog = (data: SkWithdrawalLogForm) => {
  return request({
    url: '/app/SkWithdrawalLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除提现信息LOG
 * @param id
 */
export const delSkWithdrawalLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkWithdrawalLog/' + id,
    method: 'delete'
  });
};


/**
 * 立即提现
 * @param id
 */
export const withdrawimmediately = (id: string | number | Array<string | number>) => {
  console.log(id);
  return request({
    url: '/api/test/createAccounr',
    method: 'post',
    data: id
  });
};


/**
 * 拒绝提现
 * @param id
 */
export const withdrawimmediatelyjujue = (id: string | number | Array<string | number>) => {
  console.log(id);
  return request({
    url: '/app/SkWithdrawalLog/withdrawimmediatelyjujue?id='+ id,
    method: 'get'
  });
};
